/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.movie;

import java.util.List;
import org.hibernate.Query;

import org.hibernate.Session;

/**
 *
 * @author alexnewski
 */
public class MovieHelper {

    Session session = null;

    public MovieHelper() {
        this.session = HibernateUtil.getSessionFactory().getCurrentSession();
    }

    public List getFilmTitles(int startID, int endID) {
        List<Actor> filmList = null;
        try {
            org.hibernate.Transaction tx = session.beginTransaction();
            Query q = session.createQuery("from Actor as actor where actor.idactor between '" + startID + "' and '" + endID + "'");
            filmList = (List<Actor>) q.list();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return filmList;
    }
    
}
